<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<div data-role="page" id="setting_page">
    <div data-role="header">
        <h1>Setting</h1>
    </div>
    <div data-role="content">
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="interval" >배치간격 : </label>
            <select name="interval" id="interval" data-native-menu="false">
                <option value="m20" <c:if test="${setting.job_interval eq 'm20'}">selected="selected"</c:if>>20분 간격</option>
                <option value="m30" <c:if test="${setting.job_interval eq 'm30'}">selected="selected"</c:if>>30분 간격</option>
                <option value="h1" <c:if test="${setting.job_interval eq 'h1'}">selected="selected"</c:if>>1시간 간격</option>
                <option value="h3" <c:if test="${setting.job_interval eq 'h3'}">selected="selected"</c:if>>3시간 간격</option>
                <option value="h6" <c:if test="${setting.job_interval eq 'h6'}">selected="selected"</c:if>>6시간 간격</option>
                <option value="h12" <c:if test="${setting.job_interval eq 'h12'}">selected="selected"</c:if>>12시간 간격</option>
                <option value="d1" <c:if test="${setting.job_interval eq 'd1'}">selected="selected"</c:if>>하루 간격</option>
                <option value="d2" <c:if test="${setting.job_interval eq 'd2'}">selected="selected"</c:if>>이틀 간격</option>
                <option value="d3" <c:if test="${setting.job_interval eq 'd3'}">selected="selected"</c:if>>삼일 간격</option>
            </select>
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >HiBogo URL : </label>
            <input type="text" data-clear-btn="true" name="hibogo_url" id="hibogo_url" value="<c:out value='${setting.hibogo_url}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >HiBogo ID : </label>
            <input type="text" data-clear-btn="true" name="hibogo_id" id="hibogo_id" value="<c:out value='${setting.hibogo_id}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >HiBogo Password : </label>
            <input type="text" data-clear-btn="true" name="hibogo_password" id="hibogo_password" value="<c:out value='${setting.hibogo_password}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="torrent_file_path" >Torrent파일 다운로드 위치(watch-dir) : </label>
            <input type="text" data-clear-btn="true" name="torrent_file_path" id="torrent_file_path" value="<c:out value='${setting.torrent_file_path}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="smi_file_path" >자막파일 다운로드 위치 : </label>
            <input type="text" data-clear-btn="true" name="smi_file_path" id="smi_file_path" value="<c:out value='${setting.smi_file_path}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >Transmission URL : </label>
            <input type="text" data-clear-btn="true" name="transmission_url" id="transmission_url" value="<c:out value='${setting.transmission_url}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >Transmission Port: </label>
            <input type="text" data-clear-btn="true" name="transmission_port" id="transmission_port" value="<c:out value='${setting.transmission_port}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >Transmission ID : </label>
            <input type="text" data-clear-btn="true" name="transmission_id" id="transmission_id" value="<c:out value='${setting.transmission_id}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="hibogo_url" >Transmission Password : </label>
            <input type="text" data-clear-btn="true" name="transmission_password" id="transmission_password" value="<c:out value='${setting.transmission_password}'/>">
        </div>
        
        <div data-role="controlgroup" data-type="horizontal" align="right">
            <button type="button" data-icon="check" data-iconpos="left" data-inline="true" onclick="jQuery.mobile.changePage('setting.do?method=update', {type:'post', transition: 'pop', reverse: true, data:{ interval:$('#interval').val(), torrent_file_path:$('#torrent_file_path').val(), smi_file_path:$('#smi_file_path').val(), hibogo_url:$('#hibogo_url').val().replace('http://','').replace('www.',''), hibogo_id:$('#hibogo_id').val(), hibogo_password:$('#hibogo_password').val(), hibogo_id:$('#hibogo_id').val(), transmission_url:$('#transmission_url').val().replace('http://','').replace('www.',''), transmission_port:$('#transmission_port').val(), transmission_id:$('#transmission_id').val(), transmission_password:$('#transmission_password').val() }});">저장</button>
            <button type="button" data-icon="back" data-iconpos="left" data-inline="true" onclick="jQuery.mobile.changePage('zHibogo.do?method=list', {type:'post', transition: 'pop', reverse: true});">닫기</button>
        </div>
        
    </div>
</div>